﻿namespace iFinance.IDAL
{
    using System.Collections.Generic;
    using iFinance.Entity;

    /// <summary>
    /// 支出记录数据库操作接口
    /// </summary>
    public interface IOutgoingsDAO
    {
        /// <summary>
        /// 添加支出项，并返回添加后生成的唯一编号，如果失败返回-1
        /// </summary>
        /// <param name="outgoings">要添加的支出项</param>
        /// <returns>成功返回添加后生成的唯一编号，失败返回-1</returns>
        int AddOutgoings(Outgoings outgoings);

        /// <summary>
        /// 添加支出明细项
        /// </summary>
        /// <param name="outgoingsDetail">要添加的支出明细项</param>
        /// <returns>是否成功</returns>
        bool AddOutgoingsDetail(OutgoingsDetail outgoingsDetail);

        /// <summary>
        /// 更新支出项
        /// </summary>
        /// <param name="outgoings"></param>
        /// <returns></returns>
        bool UpdateOutgoings(Outgoings outgoings);

        /// <summary>
        /// 更新支出明细项
        /// </summary>
        /// <param name="outgoingsDetail"></param>
        /// <returns></returns>
        bool UpdateOutgoingsDetail(OutgoingsDetail outgoingsDetail);

        /// <summary>
        /// 删除支出项以及其明细
        /// </summary>
        /// <param name="outgoingsID">要删除的支出项编号</param>
        /// <returns></returns>
        bool DeleteOutgoings(int outgoingsID);

        /// <summary>
        /// 查询支出明细
        /// </summary>
        /// <param name="outgoingsID">支出项的ID</param>
        /// <returns></returns>
        List<OutgoingsDetail> QueryOutgoingsDetail(int outgoingsID);

        /// <summary>
        /// 查询当前登录用户的所有支出项
        /// </summary>
        /// <returns></returns>
        List<Outgoings> QueryAllOutgoings();
    }
}
